package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.address.TbCitiesMapper;
import com.dongdongshop.pojo.cities.TbCities;
import com.dongdongshop.pojo.cities.TbCitiesExample;
import com.dongdongshop.service.address.CitieService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Service
public class CitieServiceImpl implements CitieService {

    @Resource
    private TbCitiesMapper citiesMapper;



    @Override
    public List<TbCities> getCity(String cityId) {
        TbCitiesExample tbCitiesExample=new TbCitiesExample();
        TbCitiesExample.Criteria criteria = tbCitiesExample.createCriteria();
        criteria.andProvinceidEqualTo(cityId);
        return citiesMapper.selectByExample(tbCitiesExample);
    }

    @Override
    public TbCities getById(String cityId) {
        return citiesMapper.getById(cityId);
    }
}
